<table width="100%">
	<thead>
		<tr>
			<th>&nbsp;</th>
			<th align="left" >Network Interface</th>
			<th width="100">Throughput</th>
			<th>Traffic <span>(Past 24hrs)</span></th>
			<th width="180">Port Type</th>
			<th width="20">&nbsp;</th>
		</tr>
	</thead>
<?
$odd=false;
foreach ($device->interfaces AS $interface) {
	if ($interface->ignore == false) {
		echo '<tr class="'.($odd?'odd':'').' '.($interface->ignore?'ignore':'').'">';
			echo '<td>';
			if ($interface->ifType == 6 || $interface->ifType == 117 || $interface->ifType == 71) {
				echo '<div class="port '.$interface->getStatus().'">&nbsp;</div>';
			} else {
				echo '&nbsp;';
			}
			echo '</td>';
			echo '<td class="title"><a href="/device/'.$device->id.'/interface/'.$interface->ifIndex.'/" >'.$interface->getDescription().'</a>';
			echo '<span>'.$interface->getType().'</span>';
			echo '</td>';
			echo '<td class="rate">';
				echo '<div class="in">'.$interface->getCurrentThroughput('in').'/s</div>';
				echo '<div class="out">'.$interface->getCurrentThroughput('out').'/s</div>';
			echo '</td>';
			echo '<td>';
			if (!$interface->ignore && $interface->getStatus() == 'up') {
				echo '<img class="graph" src="/graph.php?device='.$device->id.'&index='.$interface->ifIndex.'&type=interfaceTraffic&width=200&height=40&legend=0&start=-1h&bg=ffffff&border=ffffff" graph="device='.$device->id.'&index='.$interface->ifIndex.'&type=interfaceTraffic&start=-1h&title='.$interface->getDescription().' Traffic in the last hour"/>';
			} else echo '&nbsp;';
			echo '</td>';
			echo '<td class="info">';
				$info = array();
				$speed = $interface->getSpeed();
				if (!empty($speed)) {$info[] = '<b>Link Speed:</b> '.$interface->getSpeed();}
				if (!empty($interface->ifPhysAddress)) {$info[] = '<b>MAC:</b>'.$interface->ifPhysAddress;}
				if ($interface->ifMtu > 0) { $info[]=  '<b>MTU:</b>'.$interface->ifMtu;}
				echo implode('<br/>',$info);
			echo '</td>';
			echo '<td><a href="/device/'.$device->id.'/interface/'.$interface->ifIndex.'/" class="btn" >More...</a></td>';
		echo '</tr>';
		$odd = !$odd;
	}

}
foreach ($device->interfaces AS $interface) {
	if ($interface->ignore == true) {
		echo '<tr class="'.($odd?'odd':'').' '.($interface->ignore?'ignore':'').'">';
			echo '<td>&nbsp;</td>';
			echo '<td class="title"><a href="/device/'.$device->id.'/interface/'.$interface->ifIndex.'/" >'.$interface->getDescription().'</a>';
			echo '<span>'.$interface->getType().'</span>';
			echo '</td>';
			echo '<td class="rate">&nbsp;</td>';
			echo '<td>&nbsp;</td>';
			echo '<td class="info">&nbsp;</td>';
			echo '<td><a href="/device/'.$device->id.'/interface/'.$interface->ifIndex.'/" class="btn" >More...</a></td>';
		echo '</tr>';
		$odd = !$odd;
	}
}
?>
</table>